// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the INFOBUS_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// INFOBUS_API functions as being imported from a DLL, whereas this DLL sees symbols

#ifndef LISTENER_H
#define LISTENER_H

#include "DatabaseAdapter.h"
#include "Export.h"
#include "Types.h"

class INFOBUS_API IListener 
{
public:
  IListener(E_SUBJECT subj);
  virtual ~IListener();
  virtual void onMessage(const char * m) = 0;
  virtual const char* getType() { return "Listener"; }
  void setAliveBeats(bool bEnable);
protected:
  const char* getSubjectText();
  const char* getSender();

  class DatabaseAdapter * db;
};

class INFOBUS_API Dispatcher
{
public:
  Dispatcher(E_SUBJECT subj);
  virtual ~Dispatcher();
  void sendMessage(const char * m);
  void setAliveBeats(bool bEnable);
  const char* getType() { return "Dispatcher"; }
private:
  class DatabaseAdapter * db;
};

#endif
